import os
import sys
from typing import Union


class Context(object):
    SCRIPT_DIR = os.path.dirname(sys.argv[0])

    def __init__(self, sn: str):
        self._script_dir = Context.SCRIPT_DIR
        self._device_temp_dir: Union[None, str] = None
        self._host_dir: Union[None, str] = None
        self._sn: str = sn
        self._android_version: Union[None, int] = None
        self._device_model: Union[None, str] = None

    def script_dir(self) -> str:
        return self._script_dir

    def device_temp_dir(self) -> str:
        return self._device_temp_dir

    def set_device_temp_dir(self, path: str):
        self._device_temp_dir = path

    def host_dir(self) -> str:
        return self._host_dir

    def sn(self) -> str:
        return self._sn

    def set_host_dir(self, path: str):
        self._host_dir = path

    def android_version(self) -> Union[None, int]:
        return self._android_version

    def set_android_version(self, version: int):
        self._android_version = version

    def device_model(self) -> Union[None, str]:
        return self._device_model

    def set_device_model(self, model: str):
        self._device_model = model
